//
//  DataBaseHandle.h
//  A段项目,漫画
//
//  Created by dllo on 15/4/24.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import "saveCartoon.h"
#import "throughNotes.h"
@interface DataBaseHandle : NSObject
{
    //定义一个成员变量,用来指向数据库
    sqlite3 *dbPoint;
}

//单例方法
+(instancetype)shareDB;
//打开数据库
- (void)openDB;
//创建动漫表
- (void)createCartoonTable;
//创建浏览记录表
- (void)createThroughTable;
//插入动漫
- (void)insertCartoonWithID:(NSString *)comic_id PicUrl:(NSString *)url AndTiTle:(NSString *)title;
//插入浏览记录
- (void)insertThroughNotesWithID:(NSString *)comic_id Cid:(NSString *)cid PicUrl:(NSString *)url TiTle:(NSString *)title AndLastPage:(NSInteger)index;
//查询动漫
- (NSMutableArray *)selectSaveCartoon;
//查询浏览记录
- (NSMutableArray *)selectThroughNotes;
//删除动漫数据
- (void)deleteCartoonWithID:(NSString *)comic_id;
//删除浏览记录数据
- (void)deleteThroughNotesWithID:(NSString *)comic_id;
//删除动漫表
- (void)dropCartoonTable;
//删除浏览记录表
- (void)dropThroughNotesTable;
//关闭数据库
- (void)closeDB;
//更新浏览记录数据
- (void)upDateCid:(NSString *)cid ThroughNotesLastPage:(NSInteger)index ComicID:(NSString *)comicid;
@end
